package com.smart.model.util;

import com.smart.model.dtomapper.ProjectUseControlDtoMapper;
import com.smart.model.domain.ProjectUseControlDO;
import com.smart.model.vo.ProjectUseControlVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class ProjectUseControlConvert {

    public static List<ProjectUseControlVO> buildProjectUseControlVoList(List<ProjectUseControlDO> projectUseControlDOList) {
        if (CollectionUtils.isEmpty(projectUseControlDOList)) {
            return Lists.newArrayList();
        }
        List<ProjectUseControlVO> projectUseControlVOList = new ArrayList<>();
        for (ProjectUseControlDO projectUseControlDO : projectUseControlDOList) {
            projectUseControlVOList.add(ProjectUseControlDtoMapper.INSTANCE.do2VO(projectUseControlDO));
        }

        return projectUseControlVOList;
    }
}
